import BaseApi from '../BaseApi';

const controller = "/arrears";

export default {

    getArrearsList(condition) {
        return this.requestPost(controller, "/list", condition);
    },
    getArrearsStatisticsList(condition) {
        return this.requestPost(controller, "/listCount", condition);
    },
    getArrearsStatisticsOwnersList(condition) {
        return this.requestPost(controller, "/listCountOwners", condition);
    },
    arrearsPush() {
        return this.requestGet(controller, "/arrearsPush", null);
    },
    exportArrearsRecordExcel(condition) {
        return this.requestDownloadGet(controller, "/exportArrearsRecordExcel", condition);
    },
    exportArrearsStatisticsExcel(condition) {
        return this.requestDownloadGet(controller, "/exportArrearsStatisticsExcel", condition);
    },
    exportArrearsStatisticsOwnersExcel(condition) {
        return this.requestDownloadGet(controller, "/exportArrearsStatisticsOwnersExcel", condition);
    },





    /*请求封装*/
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);

    },
    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },
    requestDownloadGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestDownloadGet(newUrl, condition);
    }

}